<style>
    .indexPage-EmergencyTable-content {
        width: 100%;
    }
    #daiban-enmergencyHtml .layui-table-view {
        margin-top: 0px;
    }
</style>
<script type="text/html" template lay-done="layui.data.indexPageEmergencyTabledone(d);">
    <table id="i-EmergencyTable-table-page" lay-filter="i-EmergencyTable-table-page" class='indexPage-EmergencyTable-content'>
    </table>
</script>
<script>
layui.data.indexPageEmergencyTabledone = function (d) {
    layui.use(['admin','table'], function () {
        var table = layui.table;

		rederTable(d.params.list);
		
        function rederTable(data) {
			var options = {
				elem: '#i-EmergencyTable-table-page',
				data: data,
				limit: 100,
				cols: [
					[{
						field: 'taskname',
						title: '任务名称',
						//style: 'border-color: #fff; color: #333333;'
					}, {
						field: 'remaintime',
						width: 200,
						title: '剩余时间',
						//style: 'border-color: #fff; color: #333333;',
					}, {
						field: 'tasktypename',
						width: 120,
						title: '任务类型',
						//style: 'border-color: #fff; color: #333333;',
					}, {
						field: 'statename',
						width: 90,
						title: '状态',
						//style: 'border-color: #fff; color: #333333;',
					}]
				]
			};
			table.render(options);
		};

		//表格行点击事件
		table.on('row(i-EmergencyTable-table-page)', function(obj){
			var data = obj.data,
			id = data.id,
			connection = data.connection,
			state = data.state;
			if(state === '25') {
				location.hash = "/"+connection+'/isReview=1/id='+id;
			}else if(state === '40') {
				location.hash = "/"+connection+'/isReview=1/id='+id;
			}
		})

    })
};
</script>